/* ----------------------------- dom/window.js ------------------------------ */
VED.dom.window = VED.dom.domObject.extend({
   initialize: function( domWindow ) {
      this.parent( domWindow );
   },

   focus: function() {
      this.$.focus();
   },

   getViewPaneSize: function() {
      var doc = this.$.document,
         stdMode = doc.compatMode == 'CSS1Compat';
      return {
         width: ( stdMode ? doc.documentElement.clientWidth : doc.body.clientWidth ) || 0,
         height: ( stdMode ? doc.documentElement.clientHeight : doc.body.clientHeight ) || 0
      };
   },

   getScrollPosition: function() {
      var $ = this.$;

      if ( 'pageXOffset' in $ ) {
         return {
            x: $.pageXOffset || 0,
            y: $.pageYOffset || 0
         };
      } else {
         var doc = $.document;
         return {
            x: doc.documentElement.scrollLeft || doc.body.scrollLeft || 0,
            y: doc.documentElement.scrollTop || doc.body.scrollTop || 0
         };
      }
   },

   getFrame: function() {
      var iframe = this.$.frameElement;
      return iframe ? new VED.dom.element.get( iframe ) : null;
   }
});





